﻿namespace Home
{
    using System;
    using System.Collections.Generic;
    using System.Configuration;
    using System.IO;
    using System.Linq;
    using System.Reflection;
    using System.Text;
    using System.Threading.Tasks;

    public static class BidConfiguration
    {
        public static string AccountsCsvFileName
        {
            get
            {
                var result = ConfigurationManager.AppSettings["Bid:AccountsCsvFileName"];
                if (result == null)
                {
                    result = "bid.accounts.csv";
                }

                if (!Path.IsPathRooted(result))
                {
                    var folder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
                    result = Path.Combine(folder, result);
                }

                return result;
            }
        }

        public static string AccountsCsvFileFieldSeparator
        {
            get
            {
                var result = ConfigurationManager.AppSettings["Bid:AccountsCsvFileFieldSeparator"];
                if (result == null)
                {
                    result = "\t";
                }

                return result;
            }
        }
    }
}
